3.3 \(\int \tan ^3(c+d x) \, dx\)

Optimal. Leaf size=27 \[ \frac{\tan ^2(c+d x)}{2 d}+\frac{\log (\cos (c+d x))}{d} \]

[Out]

Log[Cos[c + d*x]]/d + Tan[c + d*x]^2/(2*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0114313, antiderivative size = 27, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 8, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {3473, 3475} \[ \frac{\tan ^2(c+d x)}{2 d}+\frac{\log (\cos (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^3,x]

[Out]

Log[Cos[c + d*x]]/d + Tan[c + d*x]^2/(2*d)

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \tan ^3(c+d x) \, dx &=\frac{\tan ^2(c+d x)}{2 d}-\int \tan (c+d x) \, dx\\ &=\frac{\log (\cos (c+d x))}{d}+\frac{\tan ^2(c+d x)}{2 d}\\ \end{align*}

Mathematica [A]  time = 0.0240356, size = 25, normalized size = 0.93 \[ \frac{\tan ^2(c+d x)+2 \log (\cos (c+d x))}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^3,x]

[Out]

(2*Log[Cos[c + d*x]] + Tan[c + d*x]^2)/(2*d)

________________________________________________________________________________________

Maple [A]  time = 0.003, size = 31, normalized size = 1.2 \begin{align*}{\frac{ \left ( \tan \left ( dx+c \right ) \right ) ^{2}}{2\,d}}-{\frac{\ln \left ( 1+ \left ( \tan \left ( dx+c \right ) \right ) ^{2} \right ) }{2\,d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^3,x)

[Out]

1/2*tan(d*x+c)^2/d-1/2/d*ln(1+tan(d*x+c)^2)

________________________________________________________________________________________

Maxima [A]  time = 0.872092, size = 42, normalized size = 1.56 \begin{align*} -\frac{\frac{1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3,x, algorithm="maxima")

[Out]

-1/2*(1/(sin(d*x + c)^2 - 1) - log(sin(d*x + c)^2 - 1))/d

________________________________________________________________________________________

Fricas [A]  time = 1.77591, size = 73, normalized size = 2.7 \begin{align*} \frac{\tan \left (d x + c\right )^{2} + \log \left (\frac{1}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3,x, algorithm="fricas")

[Out]

1/2*(tan(d*x + c)^2 + log(1/(tan(d*x + c)^2 + 1)))/d

________________________________________________________________________________________

Sympy [A]  time = 0.211822, size = 32, normalized size = 1.19 \begin{align*} \begin{cases} - \frac{\log{\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac{\tan ^{2}{\left (c + d x \right )}}{2 d} & \text{for}\: d \neq 0 \\x \tan ^{3}{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**3,x)

[Out]

Piecewise((-log(tan(c + d*x)**2 + 1)/(2*d) + tan(c + d*x)**2/(2*d), Ne(d, 0)), (x*tan(c)**3, True))

________________________________________________________________________________________

Giac [B]  time = 1.92996, size = 332, normalized size = 12.3 \begin{align*} \frac{\log \left (\frac{4 \,{\left (\tan \left (c\right )^{2} + 1\right )}}{\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1}\right ) \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \log \left (\frac{4 \,{\left (\tan \left (c\right )^{2} + 1\right )}}{\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1}\right ) \tan \left (d x\right ) \tan \left (c\right ) + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + \log \left (\frac{4 \,{\left (\tan \left (c\right )^{2} + 1\right )}}{\tan \left (d x\right )^{4} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right )^{3} \tan \left (c\right ) + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1}\right ) + 1}{2 \,{\left (d \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, d \tan \left (d x\right ) \tan \left (c\right ) + d\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^3,x, algorithm="giac")

[Out]

1/2*(log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*ta
n(d*x)*tan(c) + 1))*tan(d*x)^2*tan(c)^2 + tan(d*x)^2*tan(c)^2 - 2*log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 -
2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1))*tan(d*x)*tan(c) + tan(d*x)^2
+ tan(c)^2 + log(4*(tan(c)^2 + 1)/(tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^
2 - 2*tan(d*x)*tan(c) + 1)) + 1)/(d*tan(d*x)^2*tan(c)^2 - 2*d*tan(d*x)*tan(c) + d)